package org.chatboleh.frame.internal;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.DefaultListModel;
import javax.swing.JInternalFrame;
import javax.swing.JList;
import javax.swing.JScrollPane;

import org.apache.log4j.Logger;
import org.chatboleh.util.MessageBox;
import org.dyno.visual.swing.layouts.Bilateral;
import org.dyno.visual.swing.layouts.Constraints;
import org.dyno.visual.swing.layouts.GroupLayout;
import org.dyno.visual.swing.layouts.Leading;

//VS4E -- DO NOT REMOVE THIS LINE!
public class DocumentList extends JInternalFrame {

	private Logger logger = Logger.getLogger(this.getClass());
	private static final long serialVersionUID = 1L;
	private JList jList0;
	private JScrollPane jScrollPane0;

	public DocumentList() {
		initComponents();
	}

	private void initComponents() {
		setVisible(true);
		setLayout(new GroupLayout());
		add(getJScrollPane0(), new Constraints(new Bilateral(2, 0, 22), new Leading(-1, 207, 10, 10)));
		setSize(196, 322);
	}

	private JList getJList0() {
		if (jList0 == null) {
			jList0 = new JList();
			DefaultListModel listModel = new DefaultListModel();
			listModel.addElement("item0");
			listModel.addElement("item1");
			listModel.addElement("item2");
			listModel.addElement("item3");
			jList0.setModel(listModel);
			jList0.addMouseListener(new MouseAdapter() {
				@Override
				public void mouseClicked(MouseEvent event) {
					jList0MouseMouseClicked(event);
				}
			});
		}
		return jList0;
	}

	private JScrollPane getJScrollPane0() {
		if (jScrollPane0 == null) {
			jScrollPane0 = new JScrollPane();
			jScrollPane0.setViewportView(getJList0());
		}
		return jScrollPane0;
	}

	private void jList0MouseMouseClicked(MouseEvent event) {
//		MessageBox.info(event);
		logger.debug(event);
		if(event.getButton()==1) {	// Normal Click
			if(event.getClickCount()==2) {	// Double click
//				MessageBox.info(event.paramString());
			}
		}
		if(event.getButton()==3) {	// Right Click
//			MessageBox.info(event.paramString());
		}
	}

}
